package com.kaili.basic.service.impl;

/**
 * Created by xxx on 2019-03-07.
 */

import com.kaili.basic.mapper.CustomerAddressMapper;
import com.kaili.basic.pojo.entity.CustomerAddress;
import com.kaili.basic.service.CustomerAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author xxx
 * @Copyright: Copyright (c) 2017
 * @Company: 杭州凯立通信有限公司
 */
@Service
@Transactional
public class CustomerAddressServiceImpl implements CustomerAddressService {
    @Autowired
    CustomerAddressMapper customerAddressMapper;

    @Override
    public int addCustomerAddress(CustomerAddress customerAddress) {
        Integer count = customerAddressMapper.addCustomerAddress(customerAddress);
        if(count>0){
            return 1;
        }
        return 0;
    }

    @Override
    public int deleteCustomerAddress(CustomerAddress customerAddress) {
        return customerAddressMapper.deleteCustomerAddress(customerAddress);
    }

    @Override
    public List<CustomerAddress> getCustomerAddressList(Long customerId) {
        return customerAddressMapper.getCustomerAddressList(customerId);
    }
}
